<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <!-- <base href="https://tieba.baidu.com/" target="_blank"> -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="shortcut icon" href="https://www.baidu.com/favicon.ico" type="image/x-icon">
    <link rel="stylesheet" href="">
    <title>Document</title>
    <link rel="stylesheet" href="css/index.css">
    <style>
        .box {
            width: 100px;
            height: 100px;
            border: 1px solid black;
        }

        .red {
            background-color: red;
            float: right;
        }

        .green {
            background-color: green;
            width: 200px;
            height: 200px;
            float: left;
        }
        .green::after{
            content: 'after插入的内容';
            display: block;
            background-color: rgb(163, 99, 99);
            height: 50px;
        }
        .green:before{
            content: 'before插入的内容';
            
        }

        .yellow {
            background-color: yellow;
            float: right;
        }

        .blue {
            background-color: blue;
            float: left; 
            /* clear: both; */
        }

        .orange {
            background-color: orange;
            float: right;
            text-align: right;
        }
        .container{
            border: 1px solid red;
            width: 900px;
            /* height: 500px; */
            /* padding:20px; */
        }
        .s{
            background-color: rgb(211, 110, 110);
            width: 100px;
            height: 100px;
            float: left;
            border: 1px solid black;
        }
        .btn{
            width: 100px;
            height: 100px;
            float: left;
            clear: both;

        }
        .clearfix{
            clear: both;
        }
        
    </style>



</head>

<body>
    <!-- 浮动规律
        1.浮动的元素上边不能够超过上面没有浮动的元素
        2.块级元素的默认宽度为父元素的100%(不设置宽度的情况下)，如果该元素浮动，那么宽度为0;
        3.inline,inline-block元素浮动之后会都变成block。
        
    -->
    <div class="container">


        <div class="box red"></div>
        <div class="box green">
            <p>绿色盒子</p>
        </div>
        <div class="box yellow"></div>
        <div class="box blue"></div>
        <div class="box orange"></div>
        <span class="s">浮动inlie</span>
        <button class="btn">按钮</button>
        <!-- <div class="clearfix"></div> -->
    </div>

</body>

</html>